package com.icinfo.cloud.provider.handler;

import com.icinfo.cloud.provider.common.constant.Constant;
import com.icinfo.cloud.provider.common.utils.SMSUtils;
import com.icinfo.cloud.workflow.work.service.IWorkFlowRollAutoexcuteRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * 【V1.1.0】描述：案件定时任务处理
 *  @author tianrunjia
 *  @date 2022-04-09
 */
@Configuration
@EnableScheduling
@Slf4j
public class CaseMainScheduledHandler {

    @Autowired
    private IWorkFlowRollAutoexcuteRecordService workFlowRollAutoexcuteRecordService;

    /**
     * 【V1.1.0】描述：环节自动执行定时任务
     *  @author tianrunjia
     *  @date 2022-04-09
     */
    @Scheduled(cron = "0 0 1 * * ?")
    private void doCaseMainFlowAutomaticExcuteTask(){
        System.out.println("===================环节自动执行定时任务开启=======================");
        workFlowRollAutoexcuteRecordService.doExcuteAutomaticWorkFlow(Constant.EXECUTE_PUNISHINFORM_SENT);
/*
        try {
            SMSUtils.sendTextMessage("13675896316","测试测试","1111222");
        } catch (Exception e) {
            e.printStackTrace();
        }*/
        System.out.println("===================环节自动执行定时任务结束=======================");
    }
}
